# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=exoscale
pkgver=1.58.0
pkgrel=0
pkgdesc="Command-line tool for everything at Exoscale"
url="https://github.com/exoscale/cli"
arch="all"
license="Apache-2.0"
makedepends="go"
_gomkrev="29048924e7010732530539de67407bb2715e181b"
source="https://github.com/exoscale/cli/archive/refs/tags/v$pkgver/exoscale-$pkgver.tar.gz
	https://github.com/exoscale/go.mk/archive/$_gomkrev/go.mk-$_gomkrev.tar.gz
	"
builddir="$srcdir/cli-$pkgver"

prepare() {
	default_prepare

	mv "$srcdir"/go.mk-$_gomkrev/* go.mk/
}

build() {
	go build -o exo -ldflags "-X main.version=$pkgver"
}

check() {
	go test github.com/exoscale/cli/cmd
}

package() {
	install -Dm755 exo -t "$pkgdir"/usr/bin
}

sha512sums="
5032549d98f9eb9e411387667fe64a75b7ff4f5d830047ebae1cfada2b684fa108e5b945472347d3297f45ef0b2b87baf38750f8f9814cc60af6d08584fce0a3  exoscale-1.58.0.tar.gz
76ff5e33b58dd95ad2e89dd5d301c157ebf55ec5781433b09fdce8579bd4674c1efc85a64bb542515ae88ab933e6d5813ba108cc44e68b2644f20e94269e41a3  go.mk-29048924e7010732530539de67407bb2715e181b.tar.gz
"
